<html>
<head>
    <meta charset="utf-8">
    <title>TESTS</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/chai/4.2.0/chai.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.3.1/dist/tf.min.js"></script>
    <script src="../dist/teachablemachine-image.min.js"></script>
    <script src="../node_modules/mocha/mocha.js"></script>
    <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
</head>
<body>    
    <script type="text/javascript">
        const mochaEl = document.createElement('div');
        mochaEl.setAttribute("id", "mocha");
        document.body.append(mochaEl);

        /**
         * The purpose of this test suite is only to test that the bundle loads
         * correctly. The rest of the test suite tests the local typescript files
         */
        const assert = chai.assert;
        describe('Testing UMD Bundle', () => {
            it('should be on window', () => {
                assert.equal(typeof window.tmImage, 'object');
                assert.equal(typeof tmImage.version, 'string');
                assert.equal(tmImage.IMAGE_SIZE, 224, 'IMAGE_SIZE should be 224');
            });
        });
        setTimeout(() => {
            mocha.run()
        }, 100)
    </script>
</body>
</html>
